from django.db import models

class Goal(models.Model):
    
    title = models.CharField(max_length=200)
    description = models.CharField(max_length=500)
    user = models.CharField(max_length=200)
    deadline = models.DateField('deadline')
    progress =  models.IntegerField(null = True)
    status =  models.CharField(max_length=20, blank = True)
    verifier = models.CharField(max_length=200, blank = True)
    
    def __str__(self):
        return self.title
    
    class Admin:
        pass

class Plan(models.Model):
    goal = models.ForeignKey(Goal)
    description = models.CharField(max_length=500)
    deadline = models.DateField('deadline')
    copiedFrom = models.IntegerField(null = True, blank = True)
    frequency = models.IntegerField(null = True)
    user = models.CharField(max_length=200)
    progress =  models.IntegerField(null = True)    
    
    
    def __str__(self):
        return self.description
    
    class Admin:
        pass

class PlanStatus(models.Model):
    plan = models.ForeignKey(Plan)
    status = models.IntegerField(null = True)
    dateUpdated = models.DateField('dateUpdated')
    updateIndex =  models.IntegerField(null = True)

    def __str__(self):
        return "PlanStatus"
    
    class Admin:
        pass